﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace COFE.Core.Actions
{
    public static class IWorkSchedulerExtension
    {
        public static bool Dequeue( this IWorkScheduler workQueue,IWork work)
        {
            return workQueue.Dequeue(work.ID);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static IEnumerable<ISchedule> GetAllSchedules(
            this IWorkScheduler workQueue, Func<ISchedule, bool> filter = null)
        {
            return workQueue.GetEnqueuedSchedules(filter)
                .Concat(workQueue.GetProcessingSchedules(filter));
        }
    }
}
